home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / rexx / 538 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: news.kei.com!ub!newserve!usenet
  2. From: David J. Graff <phlatline@mhv.net>
  3. Newsgroups: comp.lang.rexx
  4. Subject: RxSockets
  5. Date: Mon, 29 Jan 1996 04:44:07 GMT
  6. Organization: Binghamton University, Binghamton, NY
  7. Distribution: inet
  8. Message-ID: <4ehjah$60@bingnet1.cc.binghamton.edu>
  9. NNTP-Posting-Host: 128.226.40.220
  10. X-Newsreader: Post Road News Reader 1.01c
  11.  
  12. I have a question about RexxSockets.  I am able to create a TCP client but   
  13. I seem to have a problem receiving anything more than once from the stream   
  14. socket. 
  15.  
  16. What I would like to do is send a message out to the remote end and read a   
  17. response. 
  18.  
  19. Here is what I am currently doing to send a message out to the remote end: 
  20.  
  21. rc = RxFuncAdd('SockLoadFuncs','RxSock','SockLoadFuncs') 
  22. rc = SockLoadFuncs() 
  23. sockfd = SockSocket('AF_INET','SOCK_STREAM',0) 
  24.  
  25. rc = SockGetHostByName('downwind.sprl.umich.edu',remote.!) 
  26.  
  27. addr.!addr = remote.!addr 
  28. addr.!family = 'AF_INET' 
  29. addr.!port = 3000 
  30.  
  31. rc = SockConnect(sockfd,addr.!) 
  32.  
  33. rc = SockRecv(sockfd,inbuf,4096,addr.!) 
  34.  
  35. /* Which prints out the connection banner */ 
  36. say inbuf 
  37.  
  38. /* Message to Weather underground */ 
  39. outmsg = "bgm" || D2C(13) 
  40.  
  41. /* Sending message */ 
  42. rc = SockSend(sockfd,outmsg,LENGTH(outmsg),addr.!) 
  43.  
  44. /* rc is 4 */ 
  45. rc = SockRecv(sockfd,inmsg,4096,addr.!) 
  46.  
  47. /* At which point the program would hang */ 
  48.  
  49. any help would be appreciated 
  50.  
  51.  
  52.  
  53. --Dave 
  54.  
  55. -- 
  56. David J. Graff     KB2RUM 
  57. phlatline@mhv.net
  58.